<!-- begin {fieldName} -->
<?php
if($modelObj->{fieldName}) {
    ?>
    <div class="form-group">
        <div class="label">
            <label>原{fieldDesc}</label>
        </div>
        <div class="field">
            <a href="<?php echo $modelObj->{fieldName}; ?>" target="_blank"><?php echo FRONT_URL.$modelObj->{fieldName}; ?></a>
            <div class="tips"></div>
        </div>
    </div>
    <?php
}
?>
<div class="form-group">
    <div class="label">
        <label>{fieldDesc}</label>
    </div>
    <div class="field"><input type="text" class="w150" style="display: inline-block;" name="{fieldName}" id="{fieldName}"  value="<?php echo $modelObj->{fieldName}; ?>">
        <br /><a href="javascript:;" id="c{fieldName}" class="UploadImg" style="clear: left; color: #fff">+ {fieldDesc}上传(mp4,文档,图片或压缩包)</a>
        <div id="tips{fieldName}" style="display: inline-block; margin-left: 5px; float:left; width: 50px;line-height: 39px;height: 39px;color: green;"></div>
    </div>
</div>
<script>
    // 依次指定 点击选择图片的元素、<input type=file> 和 回调函数
    zUploadImg({
        clicker : '#c{fieldName}',
        imgPos : '#p{fieldName}',
        size : 1,
        uploadUrl : '/file,save',
        preImg : '/images/timg.jpg',
        otherData : {
            imagePos : '位置1',
        },
        imgKey : 'data',
        backImgKey : ['data','uploadImg'],
        baseUrl : '<?php echo FRONT_URL; ?>',
        callback : function(img){
            //$("#p{fieldName}")[0].src = img;
            $("#{fieldName}").val(img);
            $("#tips{fieldName}").text('ok');
            $("#tips{fieldName}").show();
            setTimeout(function(){
                $('#tips{fieldName}').hide();//找到对应的标签隐藏
            },3000)
        },
        randomStr : 'rand{fieldName}', // 随机字符串,保证每次调用不同
    });
</script>
<!-- end {fieldName} -->